package com.lollipop.chain.simplechain;

/**
 * @Author: J.K
 * @Date: 2021-08-31 13:47
 * @Description: 单向过滤器链
 */
public class ChainTest {
    public static void main(String[] args) {
        // 待处理消息
        String msg = "大病初愈:),久别重逢，失而复得，虚惊一场，不期而遇，如约而至，来日可期";
        // 构建过滤器链
        FilterChain fc = new FilterChain();
        fc.addFilter(new HtmlFilter()).addFilter(new FaceFilter());
        // 将消息和过滤器链放入消息处理器
        MsgProcessor msgProcessor = new MsgProcessor();
        msgProcessor.setFc(fc);
        msgProcessor.setMsg(msg);
        String result = msgProcessor.process();
        System.out.println(result);
    }
}
